/**
 * Copyright (c) 2012 Axa Holding Belgium, SA. All rights reserved.
 * This software is the confidential and proprietary information of the AXA Group.
 */
package chabernac.android.wordbattle.paint.bogglesimple;

import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import chabernac.android.wordbattle.model.WordRaster;
import chabernac.android.wordbattle.paint.DrawableComposite;

public class SimpleBoggleWordRasterDrawable extends DrawableComposite {
  private final WordRaster myWordRaster;
  private final Paint myPaint = new Paint();
  
  public SimpleBoggleWordRasterDrawable( WordRaster aWordRaster ) {
    super();
    myWordRaster = aWordRaster;
    
    init();
    createLetterDrawables();
  }
  
  private void init(){
    myPaint.setStyle(Style.FILL);
    myPaint.setColor(Color.BLACK);
    myPaint.setAntiAlias(true);
  }
  
  private void createLetterDrawables(){
    for(int x=0;x<myWordRaster.getColumns();x++){
      for(int y=0;y<myWordRaster.getRows();y++){
        addDrawable(new SimpleBoggleLetterDrawable( myWordRaster.getLetter( x, y ) ));
      }
    }
  }
}
